Maximum power point tracking
Incremental conductance proof:

Pb = Ib * Vb
Ps = Is * Vs

Vb = DVs
D <= 1

Ohm's law: V = IR

I = f(V)
P = IV = Vf(V)
P' = f(V) + Vf'(V) = 0
f'(V) = -f(V)/V = -I/V = -G

---

State of Charge Estimation
Coulomb Counting using numerical methods:

integral of I dt = Q
for an interval [a,b]
Q = ((b - a) / n)(f(a) / 2 + 

P1 = 100 * (Qmax - Q1) / Qmax
Q1 = Qmax - P1 * Qmax / 100
P2 = 100 * (Qmax - Q1 - Q2) / Qmax
   = 100 * (Qmax - (Qmax - P1 * Qmax / 100) - Q2) / Qmax
   = 100 * (P1 * Qmax / 100 - Q2) / Qmax
   = 100 * (P1 / 100 - Q2 / Qmax)
   = P1 - 100 * Q2 / Qmax
